home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
Macros
/
ReadErr.aed
< prev
Wrap
Text File
|
1995-01-25
|
2KB
|
61 lines
/* ReadErr.aed -- mark errors in an Oberon module */
/* trace all */
options results
if ~show('L','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30)
/* Extract the module name and generate the error file name */
'top first'
'find ODULE' ; 'wright'
'scanf %[~;]'
'getval $scanf'
module = result
errFile = module || '.err'
/* Open the error file and skip the header */
if open('err', errFile, 'R') then do
/* Check first to see if it is a binary error file */
if readch('err', 4) = 'OAER' then do
/* Close the error file and call OEL instead */
close('err')
address command 'OBERON-A:OEL >t:ErrMsgs NOANSI COLWIDTH=70 ERRPATH=Code' module
'newwindow newfile t:ErrMsgs'
end
else do
/* Could be a text error file, try to parse it */
seek('err', 0, 'B')
/* Skip the header lines */
do i = 1 to 4
line = readln('err')
if eof('err') then do
say ' !! Error in' errFile
exit
end
end
/* We should now be positioned to read the error lines */
do i = 1
/* Read a line, parse it and store it in a stem variable */
line = readln('err')
if eof('err') then leave
parse var line 'line' errs.i.l ', col' errs.i.c ': err =' errs.i.e .
end
/* Now insert the error reports in the source file */
do j = (i - 1) to 1 by -1
'noscrupdate goto ' || errs.j.l || ' gotocol ' || errs.j.c
'noscrupdate down insline (\^-- err: ' || errs.j.e || ')'
end
end
end
else do
say ' !! Could not open' errFile
exit
end